<?php
include_once('./config.php');
include_once('./class/mysql.db.class.php');
include_once('./class/string.class.php');
$DB = new DB_Class($dbHost,$dbData,$dbUser,$dbPass,$dbOpenType);
$STR = new QG_C_STRING();
$msg = $STR->safe($_POST);
if($type == 'zc')
{
		$sql = "INSERT INTO user (user,password,question,answer,realname,qudao,sex,email,company_name,phone,address,mobile,website,code,number,customer_id)  
											VALUES('".$msg["username"]."','".md5($msg["password"])."','".$msg["question"]."','".$msg["answer"]."','".$msg["realname"]."','".$msg["qudao"]."','".$msg["sex"]."','".$msg["email"]."','".$msg["company"]."','".$msg["telphone"]."','".$msg["address"]."','".$msg["mobile"]."','".$msg["website"]."','".$msg["code"]."','".$msg["number"]."','".$msg["cutomer"]."')";
		if($DB->DB_Query($sql))
		{
		    echo '注册成功';
		}
		else
		{
		    echo '注册失败';
		}
}
elseif($type == 'dl')
{
	$sql = "SELECT * FROM user WHERE user = '".$msg["username"]."' AND password = '".md5($msg["password"])."'";
	if($DB->DB_Count($sql) > 0)
	{
		  echo '登录成功';
	}
	else
	{
		  echo '登录失败';
	}
}
?>